package com.chartboost.sdk.impl;

import java.lang.reflect.Array;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SimpleTimeZone;
import java.util.UUID;
import java.util.regex.Pattern;

public class ad
{
  public static af a()
  {
    ab localab = b();
    localab.a(Date.class, new i(localab));
    localab.a(as.class, new g(localab));
    localab.a(at.class, new h(null));
    localab.a([B.class, new h(null));
    return localab;
  }

  static ab b()
  {
    ab localab = new ab();
    localab.a([Ljava.lang.Object.class, new m(localab));
    localab.a(Boolean.class, new q(null));
    localab.a(au.class, new a(localab));
    localab.a(av.class, new b(localab));
    localab.a(y.class, new d(localab));
    localab.a(z.class, new e(localab));
    localab.a(Iterable.class, new f(localab));
    localab.a(Map.class, new j(localab));
    localab.a(aw.class, new k(localab));
    localab.a(ax.class, new l(localab));
    localab.a(Number.class, new q(null));
    localab.a(ay.class, new n(localab));
    localab.a(Pattern.class, new o(localab));
    localab.a(String.class, new p(null));
    localab.a(UUID.class, new r(localab));
    return localab;
  }

  private static class a extends ad.c
  {
    a(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      au localau = (au)paramObject;
      w localw = new w();
      localw.a("$code", localau.a());
      this.a.a(localw, paramStringBuilder);
    }
  }

  private static class b extends ad.c
  {
    b(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      av localav = (av)paramObject;
      w localw = new w();
      localw.a("$code", localav.a());
      localw.a("$scope", localav.b());
      this.a.a(localw, paramStringBuilder);
    }
  }

  private static abstract class c extends aa
  {
    protected final af a;

    c(af paramaf)
    {
      this.a = paramaf;
    }
  }

  private static class d extends ad.c
  {
    d(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      paramStringBuilder.append("{ ");
      y localy = (y)paramObject;
      Iterator localIterator = localy.keySet().iterator();
      int i = 1;
      if (localIterator.hasNext())
      {
        String str = (String)localIterator.next();
        if (i != 0)
          i = 0;
        while (true)
        {
          ac.a(paramStringBuilder, str);
          paramStringBuilder.append(" : ");
          this.a.a(localy.a(str), paramStringBuilder);
          break;
          paramStringBuilder.append(" , ");
        }
      }
      paramStringBuilder.append("}");
    }
  }

  private static class e extends ad.c
  {
    e(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      z localz = (z)paramObject;
      w localw = new w();
      localw.a("$ref", localz.b());
      localw.a("$id", localz.a());
      this.a.a(localw, paramStringBuilder);
    }
  }

  private static class f extends ad.c
  {
    f(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      int i = 1;
      paramStringBuilder.append("[ ");
      Iterator localIterator = ((Iterable)paramObject).iterator();
      if (localIterator.hasNext())
      {
        Object localObject = localIterator.next();
        if (i != 0)
          i = 0;
        while (true)
        {
          this.a.a(localObject, paramStringBuilder);
          break;
          paramStringBuilder.append(" , ");
        }
      }
      paramStringBuilder.append("]");
    }
  }

  private static class g extends ad.c
  {
    g(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      as localas = (as)paramObject;
      w localw = new w();
      localw.a("$ts", Integer.valueOf(localas.a()));
      localw.a("$inc", Integer.valueOf(localas.b()));
      this.a.a(localw, paramStringBuilder);
    }
  }

  private static class h extends aa
  {
    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      paramStringBuilder.append("<Binary Data>");
    }
  }

  private static class i extends ad.c
  {
    i(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      Date localDate = (Date)paramObject;
      SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
      localSimpleDateFormat.setCalendar(new GregorianCalendar(new SimpleTimeZone(0, "GMT")));
      this.a.a(new w("$date", localSimpleDateFormat.format(localDate)), paramStringBuilder);
    }
  }

  private static class j extends ad.c
  {
    j(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      paramStringBuilder.append("{ ");
      Iterator localIterator = ((Map)paramObject).entrySet().iterator();
      int i = 1;
      if (localIterator.hasNext())
      {
        Map.Entry localEntry = (Map.Entry)localIterator.next();
        if (i != 0)
          i = 0;
        while (true)
        {
          ac.a(paramStringBuilder, localEntry.getKey().toString());
          paramStringBuilder.append(" : ");
          this.a.a(localEntry.getValue(), paramStringBuilder);
          break;
          paramStringBuilder.append(" , ");
        }
      }
      paramStringBuilder.append("}");
    }
  }

  private static class k extends ad.c
  {
    k(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      this.a.a(new w("$maxKey", Integer.valueOf(1)), paramStringBuilder);
    }
  }

  private static class l extends ad.c
  {
    l(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      this.a.a(new w("$minKey", Integer.valueOf(1)), paramStringBuilder);
    }
  }

  private static class m extends ad.c
  {
    m(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      paramStringBuilder.append("[ ");
      for (int i = 0; i < Array.getLength(paramObject); i++)
      {
        if (i > 0)
          paramStringBuilder.append(" , ");
        this.a.a(Array.get(paramObject, i), paramStringBuilder);
      }
      paramStringBuilder.append("]");
    }
  }

  private static class n extends ad.c
  {
    n(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      this.a.a(new w("$oid", paramObject.toString()), paramStringBuilder);
    }
  }

  private static class o extends ad.c
  {
    o(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      w localw = new w();
      localw.a("$regex", paramObject.toString());
      if (((Pattern)paramObject).flags() != 0)
        localw.a("$options", x.a(((Pattern)paramObject).flags()));
      this.a.a(localw, paramStringBuilder);
    }
  }

  private static class p extends aa
  {
    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      ac.a(paramStringBuilder, (String)paramObject);
    }
  }

  private static class q extends aa
  {
    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      paramStringBuilder.append(paramObject.toString());
    }
  }

  private static class r extends ad.c
  {
    r(af paramaf)
    {
      super();
    }

    public void a(Object paramObject, StringBuilder paramStringBuilder)
    {
      UUID localUUID = (UUID)paramObject;
      w localw = new w();
      localw.a("$uuid", localUUID.toString());
      this.a.a(localw, paramStringBuilder);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.ad
 * JD-Core Version:    0.6.2
 */